define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {

    var Controller = {
        index: function () {
            $(document).on("change", "input", function () {
                // console.log(111);
                $('form[role=form]').trigger("submit");
            });

            $("#i-year").on("apply.daterangepicker", function(ev,picker){
                $(this).val(picker.startDate.format('YYYY-MM-DD') + ' - ' + picker.endDate.format('YYYY-MM-DD'));
                $('form[role=form]').trigger("submit");

                //回调事件
            });
            // $(document).on("change", "#i-year", function () {
            //     $('form[role=form]').trigger("submit");
            // });
            Form.events.selectpage($("form[role=form]"))
            Form.events.daterangepicker($("form[role=form]"))

            // Controller.api.bindevent();
        },
      
        add: function () {
            Controller.api.bindevent();
        },
        edit: function () {
            Controller.api.bindevent();
        },
        api: {
            bindevent: function () {
                Form.api.bindevent($("form[role=form]"));
            }
        }
    };
    return Controller;
});
